package com.ossean.match.main;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import com.ossean.match.lucene.LuceneIndex;
import com.ossean.match.matchprocess.MatchIncrement;

@Component
public class InitIndexMain {
	@Qualifier("luceneindex")
	@Autowired
	private LuceneIndex luceneIndex;
	
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/applicationContext_mybatis.xml");
		InitIndexMain mainClass = applicationContext.getBean(InitIndexMain.class);
		mainClass.start();
	}
	public void start(){
		MatchIncrement matchIncrement = new MatchIncrement();
		luceneIndex.run(matchIncrement);
	}
}
